type
  Resistor* = enum
    Black= 0
    Brown= 1
    Red= 2
    Orange= 3
    Yellow= 4
    Green= 5
    Blue= 6
    Violet= 7
    Grey= 8
    White= 9

proc value*(colors: openArray[Resistor]): int = 
  for x in colors[0..1]:
    result = result * 10 + x.ord